home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / util / misc / NerveEX1_0.lha / NerveEX / InstallNerveEX < prev    next >
Text File  |  1995-01-30  |  6KB  |  184 lines

  1. ; NerveEX Installer script by Torsten Ebeling (95/01/30)
  2.  
  3. (set @app-name "NerveEX")
  4.  
  5. (welcome "             NerveEX installation script\n\n"
  6.          "          Copyright 1994 by Torsten Ebeling\n\n"
  7.          "Novice   installs everything except the developer files.\n"
  8.          "Advanced installs everything without confirmation.\n"
  9.          "Expert   installs everything with confirmation of all actions.\n")
  10.  
  11.  
  12. (set def_help "\n\nIf you need more help, please refer to \"NerveEX.guide\"\n\n")
  13.  
  14. (set @default-dest "SYS:c")
  15. (set my_level @user-level)
  16. (user 2)
  17. (set nerveexdest
  18.   ;get destination directory for "NerveEX"
  19.   (askdir (prompt "Select the directory where you want to put the NerveEX executable.")
  20.           (help   "This should be a directory where you can easily access NerveEX "
  21.                   "via Workbench or CLI/Shell." def_help @askdir-help)
  22.           (default @default-dest)
  23.           (disk)
  24.   )
  25. )
  26. (user my_level)
  27.  
  28. ; Copy NerveEX files
  29.  
  30. (set @default-dest nerveexdest)
  31. (set nerveextacked (tackon nerveexdest "NerveEX"))
  32.  
  33. ; ask, if we want to overwrite the old NerveEX if it exists
  34. (set overwrite 1)
  35. (if (exists nerveextacked)
  36.   (
  37.     (set old_version (getversion nerveextacked))
  38.     (set old_ver (/ old_version 65536))
  39.     (set old_rev (- old_version (* old_ver 65536)))
  40.  
  41.     (set new_version (getversion nerveextacked))
  42.     (set new_ver (/ new_version 65536))
  43.     (set new_rev (- new_version (* new_ver 65536)))
  44.  
  45.     (set overwrite (askbool (prompt "\nYou have NerveEX "
  46.                                     old_ver "." old_rev " already installed"
  47.                                     ".\nDo you wish to overwrite it with NerveEX "
  48.                                     new_ver "." new_rev " ?\n")
  49.                             (help def_help @askbool-help)
  50.                             (default 1)
  51.                             (choices "Yes" "No"))
  52.     )
  53.   )
  54. )
  55.  
  56. (if overwrite
  57.   (
  58.   ; copy the new NerveEX file to the destination directory
  59.   (copyfiles (prompt ("\nCopying NerveEX to %s." nerveexdest))
  60.                      (help   def_help @copyfiles-help)
  61.                      (optional "oknodelete")
  62.                      (optional "askuser")
  63.                      (source "")
  64.                      (choices  "prg/NerveEX" "prg/NerveEXPrefs")
  65.                      (dest nerveexdest)
  66.                      (confirm)
  67.   )
  68.   )
  69. )
  70.  
  71.  
  72. (set overwrite 0)
  73. (if (exists "envarc:NerveEX.prefs")
  74.   (
  75.     (set overwrite (askbool (prompt "\nYou have an old preferences file already installed!"
  76.                                     ".\nAll settings will be deleted if you overwrite the old one."
  77.                                     ".\nDo you wish to overwrite it?")
  78.                             (help def_help @askbool-help)
  79.                             (default 0)
  80.                             (choices "Yes" "No"))
  81.     )
  82.   )
  83. )
  84.  
  85. (if overwrite
  86.   (
  87.     (copyfiles (prompt ("\nCopying NerveEX.prefs to envarc:"))
  88.                        (help   def_help @copyfiles-help)
  89.                        (optional "oknodelete")
  90.                        (optional "askuser")
  91.                        (source "envarc/NerveEX.prefs")
  92.                        (dest "envarc:")
  93.                        (confirm)
  94.     )
  95.     (copyfiles (prompt ("\nCopying NerveEX.prefs to envarc:"))
  96.                        (help   def_help @copyfiles-help)
  97.                        (optional "oknodelete")
  98.                        (optional "askuser")
  99.                        (source "envarc/NerveEX.prefs")
  100.                        (dest "envarc:")
  101.                        (confirm)
  102.     )
  103.   )
  104. )
  105.  
  106. (set install_icons (askchoice (prompt "\nDo you want to install the icons ?\n")
  107.                               (help def_help @askchoice-help)
  108.                               (default 1)
  109.                               (choices "No icons" "8 color icons" "4 color icons"))
  110. )
  111.  
  112. (select install_icons
  113.   (set color_str "none")
  114.   (set color_str "8")
  115.   (set color_str "4")
  116. )  
  117.  
  118. (set NerveEXIcon      (cat "icons/NerveEX_" color_str ".info"))
  119. (set NerveEXPrefsIcon (cat "icons/NerveEXPrefs_" color_str ".info"))
  120.  
  121. (if install_icons
  122.   ; then
  123.   (
  124.     (copyfiles (prompt ("\nCopying NerveEX %s color icons." color_str))
  125.                (help   def_help @copyfiles-help)
  126.                (optional "oknodelete")
  127.                (optional "askuser")
  128.                (source  NerveEXIcon)
  129.                (dest    nerveexdest)
  130.                (newname "NerveEX.info")
  131.                (confirm)
  132.     )
  133.  
  134.     (copyfiles (prompt ("\nCopying NerveEXPrefs %s color icons." color_str))
  135.                (help   def_help @copyfiles-help)
  136.                (optional "oknodelete")
  137.                (optional "askuser")
  138.                (source  NerveEXPrefsIcon)
  139.                (dest    nerveexdest)
  140.                (newname "NerveEXPrefs.info")
  141.                (confirm)
  142.     )
  143.   )
  144. )
  145.  
  146.  
  147. ; Copy guide file
  148. (user 2)
  149. (set docdest
  150.   ;get destination directory for guide file
  151.   (askdir (prompt "Select the directory where you want to put the documents.")
  152.           (help   def_help @askdir-help)
  153.           (default "HELP:")
  154.           (disk)
  155.   )
  156. )
  157. (user my_level)
  158.  
  159. ; copy the new NerveEX.guide file to the destination directory
  160. (copyfiles (prompt ("\nCopying NerveEX.guide to %s." docdest))
  161.                    (help   def_help @copyfiles-help)
  162.                    (optional "oknodelete")
  163.                    (optional "askuser")
  164.                    (source "")
  165.                    (choices  "doc/NerveEX.guide")
  166.                    (dest docdest)
  167.                    (confirm)
  168. )
  169.  
  170. (if install_icons
  171.   ; then
  172.   (
  173.     (copyfiles (prompt ("\nCopying NerveEX.guide.info to %s." docdest))
  174.                (help   def_help @copyfiles-help)
  175.                (optional "oknodelete")
  176.                (optional "askuser")
  177.                (source  "doc/NerveEX.guide.info")
  178.                (dest    docdest)
  179.                (newname "NerveEX.guide.info")
  180.                (confirm)
  181.     )
  182.   )
  183. )
  184.